<template>
	<view>
	  <web-view :src="src" v-if="src!=''"></web-view>
	</view>
	
</template>

<script>
	export default {
		data() {
			return {
				param:{},
				src:'',
				info:{},
				
			}
		},
		created(){
		
		},
		onLoad: function (res) {
				console.log(this.param);
			if(this.param.web_url){//先判断是不是iframe页面
			  for(let k in this.param){
				  this.param[k] = decodeURIComponent(this.param[k])
			  }
			
			 let url = ''
				url = this.param.web_url;
				let param = {};
				let p = this.requestParam(this.param)
				delete p.web_url;
				let str = '';
				for(let k in p){
					str += '&'+k+'='+p[k];
				}
				
				if(url.substr(0,4)!='http'){
					url = this.moxiConfig('domain')+url;
				}
				if(url.indexOf("?")>0){
					url += str;
				}else{
					url += '?'+str.substr(1);
				}

				if(this.param.front_color&&this.param.background_color){//自定义标题栏样式
					uni.setNavigationBarColor({
					    frontColor: this.param.front_color,
					    backgroundColor: this.param.background_color,
						animation: {
						        duration: 400,
						        timingFunc: 'easeIn'
						    }
					})
				}
				
	

				if(this.param.title){
					setTimeout(()=>{
						uni.setNavigationBarTitle({
						    title:this.param.title
						});
					},100)
				}
		
				
		// 		if(this.param.get_location){//当需要定位参数时
				  
		// 			uni.getLocation({
		// 			    type: 'gcj02', //返回可以用于uni.openLocation的经纬度
		// 			    success: function (res) {
		
		// 					self.src = url+"&location_la="+res.latitude+"&location_lo="+res.longitude;
		// 			    },fail() {//错误则
		// 			    	self.src = url;
		// 			    }
		// 			});

		// 		}else{
		// 			this.src = url;
		// 		}
this.src = url;
console.log(this.src);
				
				
			}
		
		},
		onShow() {
			
		},

		onReady() {
			
		

		},
		methods: {
			
		}
	}
</script>

<style lang="scss">

</style>
